package com.cheyun.netsalev3.viewmodel

import androidx.databinding.ObservableField
import androidx.lifecycle.ViewModel
import com.cheyun.netsalev3.bean.*


class DmMainViewModel() : ViewModel() {
    var showMessage = ObservableField<String>("")
    var showMum = ObservableField<Int>(0)
    var isShow = ObservableField<Boolean>(false)
    init {
    }

    /**
     * 消息回调
     */
    fun message(item: NoticeData) {
        var lists = item.rows
        if (lists.isNotEmpty()) {
            showMessage.set(lists[0].message)
            isShow.set(true)
        } else {
            showMessage.set("")
            isShow.set(false)
        }
        showMum.set(item.unread)
    }

}
